Full title: The microbiota promotes social behavior by modulating microglial remodeling of forebrain neurons .

Host-associated microbiotas guide the trajectory of developmental programs, and microbial dysbiosis is linked to neurodevelopmental conditions such as autism spectrum disorder. Recent work suggests that microbiotas modulate behavioral phenotypes associated with these disorders. We discovered that the zebrafish microbiota is required for normal social behavior, and reveal a molecular pathway linking the microbiota, microglial remodeling of neural circuits, and social behavior in this experimentally tractable model vertebrate. Examining neuronal correlates of behavior, we found that the microbiota restrains neurite complexity and targeting of forebrain neurons required for normal social behavior and is necessary for localization of forebrain microglia, brain resident phagocytes that remodel neuronal arbors. The microbiota also influences microglial molecular functions, including promoting expression of the remodeling factor c1q , which we find is required for normal forebrain neurite complexity. Several distinct bacterial taxa are individually sufficient for normal microglial and neuronal phenotypes, suggesting that host neuroimmune development is sensitive to a feature common among many bacteria. Our results demonstrate that the microbiota influences zebrafish social behavior by stimulating microglial remodeling of forebrain circuits during early neurodevelopment, and suggest pathways for new interventions in multiple neurodevelopmental disorders.


Introduction
Impaired social behavior is a hallmark of multiple neurodevelopmental disorders, including autism spectrum disorder (ASD) and schizophrenia [1]. However, the organization, function, and development of brain circuits underlying social interactions are poorly understood, and effective interventions in these disorders are elusive. Intestinal microbiota dysbiosis is also associated with multiple neurodevelopmental disorders, yet how the microbiota contributes to human health is still obscure [2].
Though several clinical studies show promising improvement in ASD behavioral symptoms following gut-brain axis interventions, optimal parameters for these interventions and the underlying mechanisms remain unclear [3].
Zebrafish are an excellent model for understanding how the microbiota influences development of the 'social brain' and generating insights to inform interventions in humans. Development of the early circuitry that regulates mammalian social behavior is difficult to observe in the prenatal brain, whereas equivalent neurodevelopment is readily visualized in vivo in transparent larval zebrafish. Zebrafish are naturally gregarious, and manifest social traits including shoaling, aggression, kin recognition, and orienting as early as 12-16 days post fertilization (dpf) [4][5][6][7][8][9]. Combining the genetic and experimental accessibility of zebrafish, we can identify precise developmental events that facilitate normal social behavior and that may go awry in neurodevelopmental disorders.
Although the entire circuitry for social interactions is still under investigation, we and others have shown that zebrafish ventral nuclei of the area ventralis telencephali (Vv) are required for normal social behavior [5,10,11]. Connectomic studies suggest that Vv may integrate input from the midbrain and olfactory bulb and send efferent projections to higher-order processing centers in the habenula, hypothalamus, and preoptic area [12][13][14][15]. Normal Vv circuit connectivity is likely established long before social orienting is expressed at 14 dpf, so the rapid, sequential development of social characteristics could represent ongoing refinement of cells required to execute social behavior [4]. For example, development of many neuronal circuits is characterized by a critical period of initial outgrowth and synapse formation followed by pruning of superfluous connections and strengthening of specific nodes [16]. Our previous work identified a subpopulation of Vv neurons required for normal zebrafish social orienting and place preference, which for simplicity we refer to according to the Gal4 enhancer trap transgene that labels them, y321 (vTel y321 ) [5,17]. Understanding how intrinsic and extrinsic factors influence vTel y321 neuronal arbor refinement during early critical periods will enable us to predict features that can modify behavioral deficits in social disorders.
Microglia, the brain's resident myeloid cells, have well-defined roles regulating brain development and function, including modifying neuronal morphology by directing axon outgrowth and refining synapses [18]. Microglia are also required in the early postnatal brain for development of normal social behavior influence neural circuit architecture, especially in brain regions that regulate social behavior, has not been studied.
In this study we use gnotobiotic techniques to identify a neuro-immune pathway linking the microbiota and a region of the zebrafish brain that regulates social behavior. First, we found that normal social behavior in late-flexion larvae (around 14 dpf) requires microbes earlier in development, suggesting a critical period for microbial input. We then reconstructed hundreds of individual vTel y321 neurons and observed significant microbial modulation of arbor complexity and targeting during the period when social behavior is developing. We found that microglia are critical for remodeling forebrain neurites during early circuit development, so we tested the hypothesis that the microbiota influences zebrafish forebrain microglia. We discovered that the microbiota promotes forebrain microglial abundance and gene expression, including promoting expression of complement pathway genes in the microglial subtypes that require their expression for vTel y321 arbor remodeling. We found that diverse strains of zebrafish-associated bacteria are capable of restoring neuronal and microglial phenotypes in GF fish.
Together, our experiments suggest that a feature common to many bacterial taxa promotes social behavior by stimulating host innate immune pathways that redistribute forebrain microglia, alter microglial function, and remodel neuronal arbors.

Results
The microbiota promotes zebrafish social behavior. Social orienting among pairs of zebrafish is robust at approximately 14 dpf [4], suggesting that neuronal circuits that facilitate this behavior develop much earlier. Microbial factors, such as those from bacteria that colonize the gut once it is patent at approximately 4 dpf, could influence these neurodevelopmental events (Fig 1A) [49]. To test the hypothesis that normal social behavior development specifically requires the microbiota early, before social behavior is expressed, we raised zebrafish GF for the first week of life, inoculated them with a normal microbiota at 7 dpf, and assessed social behavior at 14 dpf with our previously-described social orienting assay (XGF; Fig 1A, B) [5,49]. This assay accurately reproduces and measures social orienting behavior exhibited by freely-swimming larvae and adults [4,5]. Compared to "conventionalized" siblings derived GF and then inoculated with a normal microbiota on day zero (CVZ), XGF larvae spend significantly less time than CVZ controls in close proximity to and oriented at 45-90 o to the stimulus fish (Fig 1C-F, Supplemental videos 1 and 2). These results show that an intact microbiota is required early for later development of normal social behavior.
It is possible that the microbiota does not usually guide social neurodevelopment, but rather that removing the host-associated microbiota for the first week of life causes nutritional deficits that simply delay normal development. Standard length, a commonly used measure of zebrafish development, is slightly but statistically significantly reduced in XGF larvae relative to their CVZ siblings ( Fig S1A) [50].
To address the possibility that developmental delay accounts for social deficits of XGF fish, we binned social orienting measurements according to the standard length of each fish. We do not observe a difference in social orienting between XGF larvae and CVZ siblings that are 5 mm or smaller, likely because these stunted fish are unable to execute social orienting ( Fig S1B). However, social orienting remains decreased in XGF larvae size matched to CVZ controls that are 6 mm or longer ( Fig S1B).
Smaller standard length is significantly correlated with reduced orienting behavior (P=.02). However, when treatment condition is considered as a covariate using multiple regression, it is significantly predictive (P=.003) while length is not (P=.144). Therefore, treatment condition and not reduced size primarily accounts for impaired XGF social behavior.
To execute normal social orienting behavior, larval zebrafish must be able to visually detect a conspecific and rapidly change body position to reciprocate movements of the other fish. It is possible that the microbiota influences circuitry underlying the early vision and locomotion required for social behavior. To address this possibility, we simultaneously assayed vision and locomotion by comparing kinetics of the optomotor response to virtual motion in 7 dpf GF larvae and CVZ controls. We presented larvae with a full-field optomotor stimulus composed of concentric rings simulating motion toward the center of an experimental chamber [51]. This stimulus induces fish to swim toward the chamber center, followed by dispersal toward the edge after the stimulus ceases ( Fig 1G). We observe no significant differences in the kinetics or magnitude of responses to optomotor stimulus in GF fish relative to their CVZ siblings, suggesting that the microbiota does not influence early development of vision or motor output (Fig 1H, I). Additionally, average swim speed remains normal in 14 dpf XGF larvae relative to CVZ controls (Fig S1C), suggesting that the microbiota influences circuits specific to social behavior directly, rather than by modulating vision or locomotion.
The microbiota restrains vTel y321 neuronal arborization. As vTel y321 neurons are required for normal social behavior [5], we hypothesized that the microbiota might promote social behavior by modulating the number of vTel y321 cells. The vTel y321 nucleus comprises an average of 229 neurons in 7 dpf CVZ larvae, which is slightly but significantly reduced in GF larvae (Fig 2A, B). However, 14 dpf XGF larvae that cannot execute normal social behavior have a similar number of vTel y321 neurons as their CVZ siblings, indicating that the microbiota does not influence y321Et promoter expression or modulate social behavior by promoting vTel y321 neuron proliferation (Fig 2A, B). We therefore hypothesized that the microbiota could influence social behavior by modulating connectivity of vTel y321 neurons. To test this possibility, we visualized individual vTel y321 arbors using a sparse mosaic labeling technique, bloSwitch, that inefficiently recombines UAS-driven fluorescent proteins to generate random sparse labeling of Gal4-expressing cells [52]. We used a semi-automated segmentation approach to image, reconstruct and quantify mosaic RFP-expressing vTel y321 neurons and the GFP-expressing reference population from CVZ and GF siblings in 3D (Fig 2A).
Randomly sampling vTel y321 neurons across dozens of 7 dpf larval brains, we observed surprisingly diverse morphologies from short neurites with only a few branches to complex arbors hundreds of microns long (Fig 2A; CVZ: n = 73 neurons from 24 larvae; GF: n = 70 neurons from 25 larvae). Though we occasionally observed vTel y321 neurites projecting into adjacent brain regions including the preoptic area and hypothalamus, fasciculation of these neurites in large tracts made reconstruction of individual arbors impossible and excluded them from analysis. The total length of vTel y321 arbors is significantly increased in GF larvae compared to CVZ siblings and the average length of vTel y321 branches remains indistinguishable, suggesting that the microbiota restrains vTel y321 arbor length by modulating branching rather than outgrowth of individual neurites (Fig 2C, D). To assess this possibility, we quantified arbor depth, a measure of branching complexity corresponding to the maximum number of bifurcations on a given arbor. GF vTel y321 arbors are significantly deeper than those of CVZ controls, reinforcing the idea that the normal role of the microbiota is to restrain vTel y321 neurite branching (Fig 2C, D).
To examine whether impaired early vTel y321 neurite development persists at later stages when larvae can execute social behavior, we reconstructed and quantified vTel y321 arbors in 14 dpf XGF larvae ( Fig   1A, 2A; CVZ: n = 69 neurons from 14 larvae, XGF: n = 46 neurons from 13 larvae). Relative to CVZ siblings, vTel y321 arbors from 14 dpf XGF larvae retain the similar average branch length and increased total arbor length and depth observed in 7 dpf larvae (Fig 2C-E). Since exuberant vTel y321 arborization in 7 dpf GF larvae persists to late larval stages of XGF fish that exhibit impaired social behavior despite the re-introduction of the normal microbiota, we conclude that there is an early developmental window during which microbial modulation of neurodevelopment is critical for normal connectivity in circuits required for later expression of social behavior.
The microbiota guides vTel y321 arbor targeting. To assess the spatial organization of vTel y321 arbor complexity, we applied 3D Sholl analysis to segmented vTel y321 arbors in GF, XGF, and CVZ larvae.
Sholl analysis quantifies the number of times each neuronal arbor intersects a series of concentric spheres, or connective zone, centered around the soma and increasing in diameter by 1 µm (insets, Fig   3A, B) [53]. vTel y321 arbors from 7 dpf CVZ larvae cover a connective zone over 100 µm from the soma, and though arbors from GF larvae cover a similar connective zone, they exhibit a dramatic increase in complexity 10-80 µm from the soma (Fig 3A). The total number of Sholl intersections and maximum number of Sholl intersections are not dramatically different in GF larvae relative to CVZ controls, however a significant increase in both the maximum Sholl radius and Sholl radius that contains the most intersections suggests that the microbiota normally restrains distal arbor complexity (Fig 3C-F).
As with the measures of arbor complexity described above, an additional week of development following inoculation with a normal microbiota does not restore normal Sholl profiles to XGF vTel y321 arbors; in fact, the rearrangement observed at 7 dpf is even more exaggerated. Though 14 dpf CVZ vTel y321 arbors can cover a volume up to 160 µm from the soma, XGF vTel y321 arbors are nearly twice as complex as those from CVZ controls across the majority of this connective zone (Fig 3B). Total Sholl intersections, maximum Sholl intersections, maximum Sholl radius, and the Sholl radius containing the most intersections are all significantly increased in 14 dpf XGF vTel y321 arbors relative to those from CVZ siblings. Therefore, microbial modulation of vTel y321 arborization during early development is crucial to restrain a connective zone that continues to elaborate arbors as social behavior coalesces.
The hundreds of neurons that comprise the vTel y321 nucleus likely include multiple morphological subtypes. We hypothesized that the microbiota might be required for normal development of specific vTel y321 neuronal subtypes. To address this possibility, we extracted 13 morphological parameters from segmented vTel y321 neurons and used hierarchical clustering (Fig 3G, I) and factor analysis (Fig 3H, J) to group them according to morphology. Factor analysis reduced the measured dimensions into three factors that explain the most variance and plotting each neuron according to its score for the first and second factors revealed morphological similarity between neurons (Fig 3H, J). Two general categories of vTel y321 neurons are apparent at 7 dpf: the vast majority that have simple arbors with few, short branches ( Fig 3G, H: grey, blue) and a smaller subset that have long neurites with complex branching patterns ( Fig 3G, H: orange, purple). Neurons in these broad classes are further subdivided into smaller morphological clusters. vTel y321 neurons from GF larvae are overrepresented in clusters defined by increased morphological complexity, located on the right side of the dendrogram and factor analysis plots (Fig 3G, H). Complex arbors remain over-represented in 14 dpf XGF larvae relative to their CVZ siblings ( Fig 3I, J: orange, purple). Therefore, it appears that the majority of vTel y321 neurons analyzed in GF or XGF fish are morphologically similar to those from CVZ siblings, but that the microbiota normally restrains arborization of a subset of vTel y321 neurons that become dramatically more complex in GF or XGF conditions. To assess how the microbiota rearranges vTel y321 neurites relative to the rest of the forebrain, we adapted existing tools and applied an automatic, signal-based pipeline to register individual vTel y321 neurons to a reference vTel y321 nucleus ( Fig S2, Supplemental videos 3 -6). We expected that vTel y321 subtypes might express some degree of spatial arrangement according to arbor morphology, perhaps with simple neuron somata clustered near the midline and complex neuron somata arranged at the periphery to project their neurites into adjacent functional regions. However, vTel y321 somata do not appear organized in obvious patterns based on neurite morphology. As expected, the most complex neurites are significantly less dense in CVZ controls than in larvae raised GF or XGF, respectively.
Viewed laterally, (bottom panels in Fig S2A, B) it is apparent that the microbiota is required for vTel y321 neurites to reach their normal targets in the ventral portion of the anterior commissure rather than the dorsal anterior commissure targeting observed in both GF and XGF larvae.
Diverse bacterial strains promote forebrain microglial abundance and restrain vTel y321 neurite density. We hypothesized that the microbiota might restrain vTel y321 arborization via microglia, the brain's resident immune cells that regulate neurite outgrowth and pruning [54]. Though social phenotypes are not expressed until 14 dpf, our experiments provide evidence that the microbiota modulates vTel y321 neuronal morphology as early as 7 dpf. If the microbiota exerts this influence by modulating development of forebrain microglial populations, then altered microglia should be apparent in 7 dpf GF larvae. To test this hypothesis, we compared forebrain microglia of GF mpeg1:mCherryTg larvae to those of CVZ sibling controls (Fig 4A, C). The mpeg:mCherry transgene is expressed in both microglia and circulating macrophages, so we used brightfield images to semi-automatically segment the CNS boundary and distinguish these cell types (orange dotted line). Initial microglial accumulation in the zebrafish CNS largely occurs before microbiota colonization, so developmental delay between GF and CVZ larvae should not affect microglial establishment in the brain [27,55]. However, since microglia distribution remains dynamic after colonization and some GF larvae are smaller than their CVZ siblings, microglial counts were normalized to forebrain volume. Forebrain microglia are significantly fewer in GF larvae relative to CVZ controls, reinforcing the conclusion that the microbiota is required for normal microglial abundance in the zebrafish forebrain (Fig 4A, C).
We hypothesized that specific bacterial strains restrict vTel y321 arborization and promote microglial abundance. To assess this, we developed a pipeline for high-throughput screening of previouslyisolated zebrafish-associated bacterial strains [46]. In fish raised CVZ (gray), GF (aqua), or derived GF and mono-associated at day 0 with individual bacterial strains (purple), we simultaneously imaged mCherry-expressing microglia and GFP-expressing vTel y321 neurons and, using intensity-based thresholding of vTel y321 neurons and a brightfield image to segment the forebrain surface, quantified neuropil density in 3D (Fig 4A-D). As expected, total vTel y321 neuropil density is significantly increased in GF larvae relative to CVZ siblings at 7 dpf (Fig 4B, D). Interestingly, mono-association with gramnegative Aeromonas veronii (strain ZOR0001) or Enterobacter cloacae (strain ZOR0014), and with gram-positive Staphylococcus sp. (strain ZWU0021) all at least partially restore forebrain microglial abundance and vTel y321 neuropil density defects in GF larvae, though the effects of Enterobacter on microglial abundance and the effects of Staphylococcus on vTel y321 neuropil density are trending but not statistically significant. These results suggest that a general feature common among diverse microbial taxa influences zebrafish forebrain neurodevelopment.
Microglia are required for vTel y321 neuronal arborization. Microglia adopt diverse roles throughout neurodevelopment, starting as regulators of neuronal cell death, axon outgrowth, and fasciculation during early development and transitioning to steady-state regulation of synapse maturation, function, and pruning [18]. Our results suggest that the microbiota may restrain vTel y321 arbor complexity and targeting by promoting the abundance of forebrain microglia available to remodel vTel y321 arbors.
Indeed, microglial depletion in the murine hippocampus increases spine density of hippocampal CA1 neurons and impairs social behavior [20]. However, it is also possible that zebrafish forebrain microglia are not remodeling vTel y321 arbors at this timepoint and that the microbiota therefore influences microglial abundance and vTel y321 arbor complexity independently. To address this possibility, we reduced forebrain microglia by injecting embryos with a previously validated morpholino against the microglial gene irf8 [56] and measured microglial abundance and vTel y321 neuropil density as described above ( Fig 4E). As observed previously [56], irf8 morpholino significantly reduces microglia relative to uninjected or random control-injected animals ( Fig 4F). vTel y321 neuropil density was also increased in irf8 morphants relative to uninjected or random control-injected siblings, providing strong evidence that microglia restrain vTel y321 arborization during early larval development ( Fig 4G). To our knowledge, this is the first demonstration that microglia are required for normal neuronal arborization in zebrafish larvae.
Further exploring the link between forebrain microglia and neuronal arborization, we used the approach described above to compare the depth within the forebrain of microglia and vTel y321 arbors in CVZ and GF larvae ( Fig S3A). The defects in microglial abundance and neuropil density described above are recapitulated ( Fig S3B, C), and the dorsal shift in vTel y321 neuropil density that we observed in individually segmented neurons from GF larvae is also apparent when the entire population is quantified, as the 3D center of mass of the vTel y321 neuropil is shifted dorsally in GF larvae relative to CV controls ( Fig S3D). The average dorsoventral position of forebrain microglia in GF larvae is also significantly reduced relative to microglia in CVZ larvae (Fig S3E, F). Together, these findings suggest that the microbiota may restrain dorsal vTel y321 neurite targeting by specifically influencing the number of microglia in dorsal forebrain territories.
The microbiota does not influence forebrain microglial morphology or dynamics. It is possible that in addition to promoting microglial localization, the microbiota also promotes microglial phagocytic activity, which is required for their role in responding to local insult, clearing apoptotic material, and for normal synaptic pruning and maturation during brain development [18]. Microglia are traditionally classified as either "ramified" or "amoeboid." Ramified microglia do not travel through the tissue but scan relatively stable territories with dynamic processes that monitor, maintain, and prune synapses [57]. Amoeboid microglia retract many of their processes, can proliferate, and migrate through tissue in response to infection or injury. As microglia executing these activities have distinct morphologies, measurements of microglial morphology can be used to assess the proportion of the microglial population available for each function. We used semi-automated fluorescence-based segmentation to quantify microglial morphology ( Fig 5A). In 7 dpf GF larvae and CVZ controls, we observed diverse morphologies that include ramified microglia with long, complex branching patterns and amoeboid microglia with larger cell bodies and fewer branches ( Fig 5A). However, we did not observe significant differences in microglial total length or number of endpoints between GF and CVZ larvae (Fig 5B, C).
Though this suggests that the microbiota does not influence forebrain microglial morphology, microglial process dynamics have also been linked to microglial activity surveilling the surrounding tissue and remodeling synapses [57][58][59]. To test the hypothesis that the microbiota restrains vTel y321 arbor density by influencing microglial process dynamics without affecting the morphological subtypes present, we The microbiota influences microglial gene expression. As brain-resident immune cells that shape neurodevelopment, microglia are uniquely positioned to receive molecular input from the microbiota and modulate neural circuits. Though the microbiota is required for forebrain microglial abundance and vTel y321 arborization, it remains unclear how these phenotypes are linked at the molecular level. To identify candidate microglial genes that are modulated by the microbiota and regulate microglial function during early brain development, we identified microglia in an existing single-cell RNA sequencing (scRNAseq) dataset from 6 dpf larvae raised either GF or CVZ [60]. Reclustering the 392 cells in Cluster 36 [60], which is the only mpeg1.1 + immune cell cluster and therefore likely includes macrophages and microglia, generated nine new subclusters ( Fig 6A). Cells from CVZ and GF larvae are evenly distributed throughout the nine clusters (Fig S4A), consistent with our morphological analysis and indicating that the microbiota does not affect the relative abundance of each cell type.
Next, we sought to determine whether this clustering accurately separates microglia and macrophages.
The common developmental origin and extreme transcriptional similarity between microglia and macrophages decreases the utility of individual "marker" genes, even when used in multi-gene combinations [18]. To address this issue, we mapped expression of a 75-gene core microglial fingerprint to our nine clusters (Fig 6B, Supplemental Table 1). Critically, though individual genes in this list may be expressed in both macrophages and microglia, combinatorial expression of the entire fingerprint is unique to microglia. A significantly greater percentage of cells (for many genes > 80%) in subclusters 1, 2, and 4 express the microglial fingerprint at higher levels than the other clusters, indicating that the cells in these clusters are predominantly microglia. As they also express mpeg1.1, cells in the remaining clusters are likely macrophages. However, our searches for known markers of macrophage subsets, including border associated, M1, and M2 macrophages, did not reveal unique identities among the macrophage clusters [61][62][63]. It is possible that these macrophage clusters represent biologically relevant cell types or states, but the lack of pro-inflammatory challenge in this dataset likely minimizes the representation of activated macrophages and small sets of qualitative markers may be insufficient to distinguish macrophage subtypes.
Focusing on microglial clusters 1, 2, and 4, we hypothesized that they represent ramified and amoeboid microglial subtypes and examined expression of previously described markers for ramified and amoeboid microglia in the zebrafish brain [64]. A large percentage of Cluster 1 cells express amoeboid microglial markers at high levels, especially ccl34b.1, lgals9l3, lgals3bpb, apoc1, and apoeb ( Fig 6C).
Cluster 4 cells, on the other hand, do not strongly express these amoeboid microglial markers and instead express a ramified microglia signature including aif1l, cmklr1, and ccl35.2 ( Fig 6C). Cluster 1 and Cluster 4 are tightly linked in UMAP space with several cells of each cluster overlapping, likely corresponding to the ability of larval zebrafish microglia to rapidly cycle between ramified and amoeboid states ( Fig 6A) [65]. Hierarchical clustering suggests that Cluster 1 amoeboid microglia are more closely related to Cluster 2 cells than the ramified microglia in Cluster 4 ( Fig 6A). Though they do not express an amoeboid or ramified molecular signature, Cluster 2 microglia strongly express proliferative markers (mki67, pcna) that are not expressed in the amoeboid or ramified microglia of Clusters 1 and 4 ( Fig 6C). Larval zebrafish microglia proliferate by adopting an amoeboid morphology, dividing, and rapidly extending ramified processes again [65], so it is unsurprising to observe a large proliferative population of microglia closely linked to amoeboid microglia in UMAP space.
Having identified microglial clusters in our scRNAseq data, we used a gene ontology (GO) approach to assess whether the microbiota influences gene expression in these cells (Fig 6D, Supplemental Tables   2-3). In both amoeboid and ramified microglia, the microbiota restrains expression of genes in the expansive crystallin family. As described in Massaquoi et al. (2022), increased expression of highly stable Crystallin proteins across most cell types in GF larvae suggests globally more quiescent cell states. In amoeboid microglia, the microbiota restrains expression of migration and chemotaxis genes while promoting expression of genes linked to lysosomal function, nucleotide metabolism, and mitochondrial function (Fig 6D, bottom). In ramified microglia, the microbiota restrains expression of lysosomal genes while promoting proteasome gene expression. In these cells, the microbiota also promotes expression of a handful of genes in unique GO-terms including "defense response to Grampositive bacterium," "regulation of I-kB kinase/NF-kB signaling," and "peptidoglycan muralytic activity," suggesting that microglial responses to microbial signaling may also be affected. c1q expression is promoted by the microbiota and required for vTel y321 neuronal arborization.
Our GO analysis suggests that ramified and amoeboid microglia have altered lysosomal and proteasomal function. We also detected microbial modulation of other microglial pathways that facilitate arbor remodeling and trogocytosis, especially the complement pathway [66] (Supplemental Tables 4-5).
Zebrafish express orthologues of all mammalian complement components [67], and we observed differential expression of c1qa, c1qb, c1qbp, cd59, cfbl, fosb, and grn1 in GF relative to CVZ microglia ( Fig 6E). Complement pathway genes are more strongly expressed in ramified microglia than amoeboid microglia (Fig 6E), which is unsurprising as ramified microglia are thought to be the primary synaptic and axonal sculptors [62]. Except for fosb, expression of each gene decreases in GF relative to CVZ ramified microglia, suggesting that the normal role of the microbiota is to promote complement expression in these cells (Fig 6E, teal). In amoeboid microglia, c1qbp, cfbl, fosb, and grn1 expression is not significantly affected by the microbiota, but expression of cd59, c1qa, and c1qb increases in GF relative to CVZ amoeboid microglia (Fig 6E, orange). Therefore, though the microbiota clearly promotes expression of a molecular pathway that regulates neurite remodeling in ramified microglia, there may also be complex compensatory effects in other cell types and states.
As our scRNAseq data represent a temporal snapshot of expression across the organism, we used fluorescence in situ hybridization RNA labeling to test whether c1qa expression is affected by the microbiota specifically in 7 dpf larval forebrain microglia (Fig 7A). We did not detect any labeling in either group with a probe against c1qb but cannot exclude inefficient probe binding. Though, as we observed previously, microglial size is unchanged (Fig 7B), the average c1qa intensity in each microglial cell and average c1qa punctum intensity are significantly reduced in GF larvae relative to CVZ siblings (Fi 7C, D). Many of the microglia we imaged did not have any c1qa puncta (Fig 7A-C), however, the number of c1qa puncta is positively correlated with microglial volume. This may represent the phenotypic continuum from amoeboid to ramified microglia, which is weaker in microglia from GF larvae (CVZ, R 2 =.1271; GF, R 2 =.0465).
It is possible that the impaired vTel y321 neurite density and c1q expression we observe in GF larvae are only coincident, unrelated phenomena. To test whether decreased c1q expression can affect vTel y321 neurite density even in the presence of a normal microbiota, we reduced c1qa and c1qb expression by co-injecting translation-blocking morpholinos at the 1-cell stage, raising the embryos to 7 dpf, and assaying both vTel y321 neurite density and microglial abundance as described above (Fig 7E). c1q knockdown does not affect forebrain microglial abundance (Fig 7F). In contrast, vTel y321 neurite density is significantly increased relative to siblings that were not injected or injected with random control morpholino ( Fig 7G). Unsurprisingly, c1q knockdown does not increase vTel y321 neurite density as dramatically as the irf8 morpholino-mediated reduction in microglial abundance. Complement pathway genes, especially c1q, can also mediate synaptic remodeling when expressed and secreted by neurons and astrocytes [31], and our morpholino injection likely results in ubiquitous knockdown. However, c1qa and c1qb are almost exclusively expressed by the microglia-containing Cluster 36 (Fig S4B), so increased vTel y321 neurite density likely results from impaired microglial remodeling rather than misfunction in neurons or astrocytes. This is the first demonstration, to our knowledge, that the complement system mediates microglial remodeling of neural circuits in zebrafish and reinforces the conclusion that microbial modulation of microglial abundance and function converge to affect neuronal arbor remodeling.

Discussion
Our key finding is that the microbiota is required during an early period of development for zebrafish to establish normal social behavior that only manifests at a later developmental stage. This conclusion is the result of several different lines of evidence. Social behavior requires the vTel y321 nucleus, which is homologous to 'social nuclei' in other vertebrate models. We found that the microbiota significantly alters projections of a subset of vTel y321 neurons by restraining complexity of their neurites. We also found that the microbiota is required for infiltration of the appropriate number of microglia into the vTel y321 brain region, and that these microglia refine vTel y321 neurites during early development. We found that a diverse set of individual zebrafish-associated bacterial strains are sufficient for normal forebrain microglial abundance and vTel y321 neurite density. We also found that the microbiota influences microglial gene expression, including tuning levels of complement pathway genes that are required for vTel y321 neurite remodeling. We discuss each of these discoveries in turn.
We observed that the microbiota is required early for normal social behavior exhibited at least a week later, suggesting that the microbiota influences social behavior by modulating neurodevelopment during an early sensitive period. A previous study identified an L. rhamnosus strain that can promote shoaling in otherwise conventionally-raised zebrafish [42], but to our knowledge, ours is the first study to demonstrate that an intact microbiota is required for normal zebrafish social behavior such as conspecific orienting (Fig 1). These findings are consistent with the association between dysbiosis and neurodevelopmental disorders including ASD [2]. The zebrafish microbiota is also required for normal activity and anxiety-like behavior, suggesting that these phenotypes could be linked to the impaired social behavior we observe [44]. However, GF larvae and their CVZ siblings perform similarly in our optomotor assay and motor behavior remains unaffected in 14 dpf XGF larvae, thus the social defects we observe in XGF larvae may instead result from impaired integrative circuits downstream of sensory input and upstream of motor output. Altered anxiety-like behavior has also been reported in GF mice, so future experiments could explore whether microbial modulation of anxiety and social behavior intersect in brain regions such as the subpallium, which in zebrafish includes vTel y321 neurons [68].
As the microbiota is required early for later-developing social behavior, we postulated that it influences early neurodevelopmental events specifically in circuits that regulate social behavior. Therefore, we focused on whether the microbiota is required for normal development of subpallial vTel y321 neurons, which are required for social behavior [5]. This region of the zebrafish brain is thought to be an integrative part of a circuit homologous to subpallial regions of the mammalian brain that also regulate social behavior, including the lateral septum, preoptic area, and hypothalamus [12][13][14]. Whether development of these regions, which regulate murine social behavior, is also influenced by microbial signals has not been investigated. However, several previous studies found that the microbiota is required for normal dendrite morphology in the murine anterior cingulate cortex, amygdala, and hippocampus [69,70], so it seems likely that microbial modulation of social behavior in other vertebrates could also occur by modulation of circuit connectivity as we observed in zebrafish vTel y321 neurons.
The changes in neuronal morphology we observe could be, at least in part, a downstream effect of microbial modulation of gene expression in vTel y321 neurons, as the microbiota has widespread impact on gene expression in the zebrafish CNS [60]. Though studies examining the microbial modulation of neuronal gene expression in rodents have largely focused on the cortex and hippocampus, altered amygdala expression of genes including BDNF and multiple neurotransmitter pathways could also affect social behavior by modifying neuronal morphology or connectivity [34,40,68,[71][72][73]. For example, oxytocin signaling in the murine hypothalamus is altered following probiotic treatment [74][75][76]. As hypothalamic oxytocin is also important for zebrafish social behavior, it will be interesting to investigate whether microbial modulation of social behavior, neuronal gene expression, and cytoarchitecture intersect in forebrain neuromodulatory systems [77].
Neuronal morphology is the foundation for circuit connectivity and function, so our finding that the microbiota influences the morphology and targeting of subpallial vTel y321 neurons provides strong evidence that the microbiota normally plays a critical role in establishing social circuitry. The exuberant arborization we observe early in GF fish persists even with an additional week of development in the presence of an intact microbiota, suggesting that vTel y321 connectivity impaired during early development results in persistently mis-wired circuits. Microbial modulation of neurite complexity appears critical for normal ventral targeting of many vTel y321 neurites; we observed GF or XGF vTel y321 neurites extending toward dorsal destinations rather than extending ventrally as in CVZ controls. It will be interesting to further investigate the functional consequences of vTel y321 neurite ventral targeting and the mechanisms by which the microbiota normally modulate that targeting. Dopaminergic neurons and projections populate the most ventral aspects of the zebrafish subpallium and synapse with vTel y321 neurites that project ventroposteriorly toward the anterior commissure, raising the exciting possibility that the microbiota influences social behavior by promoting connectivity between vTel y321 neurons and monoamine circuits known to regulate social reward [78][79][80][81].
Since microglia are ideally positioned to both receive microbial signals and modify neurons, we hypothesized that the microbiota promotes social behavior by influencing development or function of microglia that modify vTel y321 neurites. There is precedence for this idea in the literature; murine microbiota disruption impairs responses to social novelty and alters microglial morphology and reactivity in the hippocampus and cortex [72,82]. Microglia in GF mice are also metabolically dysfunctional, larger, less mature, less responsive to LPS challenge, and more abundant in the cortex, corpus callosum, hippocampus, olfactory bulb, and cerebellum than in specific pathogen free (SPF) controls [48,83,84]. Contrary to these murine phenotypes, zebrafish forebrain microglia are reduced in GF larvae relative to CVZ controls and forebrain microglial morphology does not appear influenced by the microbiota. We also do not observe an effect on the ratio of amoeboid and ramified microglia. How can these results be reconciled? One possibility is that the microbiota has differential effects on microglia across the brain, as microglial subtypes are heterogeneously distributed [62]. Microglia are drawn into the brain by chemokine signaling and neuronal apoptosis before 4 dpf, prior to microbiota colonization [27,55,85]. The number of vTel y321 neurons is similar in GF and CVZ fish, and apoptotic neurons are largely absent by 6 dpf, so it is unlikely that the microbiota draws microglia to the developing forebrain by promoting apoptosis [55]. It is also possible that the microbiota has differential effects on early larval and juvenile microglia, which have distinct developmental origins and neuroimmune functions [24]. Further study will be necessary to gain a deeper understanding of the role of the microbiota in promoting or suppressing microglial development or dynamics and how this varies across brain regions, developmental time, and taxa.
The three microglial clusters we identify likely include amoeboid, ramified, and proliferative microglia, and represent previously-identified microglial heterogeneity across the zebrafish brain [62,64]. Our ccl34b.1 + population ("amoeboid" cluster 1) likely corresponds to optic tectum-enriched neurogenic associated microglia (NAMs) and our ccl34b.1population ("ramified" cluster 4) likely corresponds to hindbrain-enriched synaptic-region associated microglia (SAMs) [62]. Separating microbial modulation of gene expression in distinct microglial functional subtypes enables us to identify homeostatic, neuroinflammatory, and parainflammatory effects of the microbiota [86]. In amoeboid cluster 1 NAMs the microbiota restrains expression of migration and chemotaxis genes while promoting expression of genes linked to lysosomal function, nucleotide metabolism, and mitochondrial function. Combined with the change in Crystallin gene expression and impaired mitochondrial function that we and others describe [60,84], this supports the idea that the microbiota is critical for normal metabolic activity in amoeboid microglia. Our observation that the microbiota broadly promotes expression, in amoeboid microglia, of genes involved in mitochondrial oxidative phosphorylation is consistent with the idea that the microbiota supports microglial function in part by minimizing mitochondrial oxidative stress [48,60].
The microbiota has the opposite effect on lysosomal function in ramified microglia, where it also promotes expression of many proteasomal pathway genes. In addition to regulating cell homeostasis, the microglial proteasome is also involved in microglial activation in response to injury or infection. This suggests that the microbiota partially suppresses ramified microglia reactivity, which is linked to multiple neurological disorders, perhaps by providing innate immune training [87,88]. Hypothesizing that the microbiota might influence vTel y321 neurite remodeling via microglia resident in the forebrain neuropil, we identified a suite of complement pathway genes with microbiota-promoted expression in ramified cluster 4 SAMs. The complement system is a well-studied mechanism through which microglia remodel neurites and zebrafish express all complement components [67,89], and our discovery that c1qa and c1qb are required for normal vTel y321 neurite density suggests that complement-mediated microglial neurite remodeling is conserved across vertebrates. Contrary to the complement downregulation we observe in ramified microglia from GF larvae, expression of multiple complement factors is increased in microglia isolated from adult GF mice relative to specific pathogen-free (SPF) controls [83,84]. A subsequent study observed decreased expression of complement components C1qbp and integrin subunit alpha X (Itgax) in microglia from newborn GF mice [90], so these results may represent a difference in microglial function between steady state maintenance of the adult brain and early postnatal development. However, we also observe an upregulation of complement pathway genes specific to amoeboid microglia that suggests the microbiota may not affect all functional microglial subtypes equally. Normally, amoeboid microglia are more abundant in neurogenic regions, where rather than remodeling synapses they engulf apoptotic cell corpses [62]. It is intriguing to speculate that microbial dysbiosis could blur the lines between functionally discrete microglial subtypes, resulting in a brain that is both profoundly mis-wired and unable to respond appropriately to future insult.
Mono-association of GF zebrafish with multiple commensal bacterial strains, including the gramnegative Aeromonas veronii strain ZOR0001 and Enterobacter cloacae strain ZOR0014, and grampositive Staphylococcus sp. Strain ZWU0021, at least partially restore defects in forebrain microglial abundance and vTel y321 neurite density. This suggests that common microbial features shared between gram-negative and gram-positive bacterial strains can activate a host pathway evolved to respond to diverse microbes, such as the complement pathway. For example, microglial function and homeostasis phenotypes in adult GF mice can be restored by the common bacterial fermentation product acetate [84], though the dominance of facultative aerobic strains in the larval zebrafish microbiota suggests that the microbial modulation of microglia that we observe occurs by a different mechanism [46]. Not all mono-associated bacterial strains restored forebrain neurodevelopmental features to the same degree. This is consistent with the idea that distinct bacterial strains can elicit different degrees of innate immune activation, including complement signaling [91,92]. It is thus easy to imagine how distinct microbiota compositions could result in variable levels of microglial complement signaling, and therefore synaptic pruning, predisposing some individuals to neurodevelopmental disorders such as ASD.
Effective intervention in diverse neurodevelopmental disorders requires understanding both intrinsic and extrinsic pathways that guide development. The neurodevelopmental processes that build social behavior across taxa are poorly understood. Our study reveals microbial modulation of social behavior in a model vertebrate well-suited to simultaneous study of the microbiota, brain, and immune system [93], and provides the first in-depth look at how interactions among these components modulate circuit formation and maintenance, and behavior.

Ethics statement. All zebrafish experiments were approved by the University of Oregon Institutional
Animal Care and Use Committee (protocols 18-08, 18-29, and 20-15).
Zebrafish lines and husbandry. All zebrafish lines were maintained as previously described at 28˚C with a 14/10 light/dark cycle [94]. AB x TU strain wild-type fish were raised CVZ and GF for behavior experiments. For vTel y321 sparse mosaic labelling, Tg(14xUAS-E1b:UBCi-blo-nls-emGFP-βglobin-blolyn- TagRFPT Gnotobiology. Zebrafish embryos were raised GF, XGF, or CVZ as previously described [49,95]. Briefly, embryos were treated from 0-6 hours post-fertilization (hpf) in embryo medium (EM) containing 100 µg/mL ampicillin, 250 ng/mL amphotericin B, 10 µg/mL gentamycin, 1 µg/mL tetracycline, and 1 µg/mL chloramphenicol. In a class II A2 biological safety cabinet, embryos were briefly surfacesterilized with 0.1% PVP-I and 0.003% sodium hypochlorite, washed with sterile EM, and transferred to 50 mL tissue culture flasks at a density of 1 fish/1 mL sterile EM. CVZ flasks were inoculated with 200 µl water from the parental tank immediately following the GF derivation procedure. Mono-associated larvae were generated as previously described [49], except that washed bacterial culture was added to GF flasks at day 0 at approximately 10 6 CFU/mL. Inoculated strains are previously described, and included Aeromonas veronii strain ZOR0001, Enterobacter cloacae strain ZOR0014, and Staphylococcus sp. strain ZWU0021 [46]. For flasks containing 7 dpf larvae, sterility was assessed by direct visualization of microbial contaminants with phase optics on an inverted microscope at 40x magnification once per day and by culturing media on LB agar at 28˚C for two days following terminal sampling. XGF larvae and CVZ siblings were inoculated with system water at 7 dpf and fed rotifers three times daily until terminal sampling at 14 dpf.
Behavior. Social behavior was assessed with our previously published dyad assay for post-flexion larval and adult zebrafish [4,5]. Briefly, AB x TU 14 dpf sibling pairs for each condition were placed in isolated custom-built acrylic tanks (50 mm width x 50 mm length x 20 mm depth), and allowed to interact for 10 minutes via adjoining transparent tank walls. Larvae were imaged from below at 10 fps using a Mightex SME-B050-U camera. The arena was illuminated from above with a white LED panel (Environmental Lights) with light-diffusing plastic as a tank lid to improve image quality. Fish that spent <10% of the experiment in motion (moving at least one-third of their total body length per frame) were not included in subsequent analysis. Social interaction was defined as the average relative distance from the divider and the percentage of time spent orienting at 45°-90°, and these parameters were measured and analyzed using our previously described computer vision software written in Python (available at https://github.com/stednitzs/daniopen). To account for changes in nutrition between fish, standard length was measured as previously described [50].
Optomotor response was assessed using a previously described "virtual reality" system for assessing zebrafish behavior, measuring swim response in 7 dpf larvae to concentric rings simulating motion towards the center of a container [96]. Briefly, we used infrared illumination to simultaneously record the swim responses of 9 AB x TU larvae at a time in 10 cm shallow glass containers filled with EM.
Larvae were imaged at 30 frames per second. Visual stimulus was projected on a screen underneath the dishes for 20 seconds and consisted of concentric rings moving toward the dish center, followed by a 20-second refractory period. Responses are the average of 46-59 stimulus trials per fish, presented over 1-hour.
Sparse mosaic neuronal labeling. For sparse mosaic recombination of GFP and RFP transgenes in vTel y321 neurons, y321Et; UAS-bloswitch; hsp70lB3 larvae were heat shocked 24 hours ahead of terminal sampling (at 6 dpf or 13 dpf) by immersing sterile flasks in a 37˚C water bath for 30 minutes [52]. Larvae were returned to 28˚C for an additional day following heat shock.
Immunocytochemistry. Larval zebrafish were immunolabeled as previously described [5]. Briefly, 7 dpf larvae were euthanized with MS-222, fixed in 4% paraformaldehyde at room temperature overnight, permeabilized in phosphate-buffered saline (PBS) with 0.5% Triton X-100 (PBSTx), and then blocked overnight at room temperature in PBSTx with 5% normal goat serum, 2% bovine serum albumin, and 1% DMSO. Larvae were then treated with primary antibodies overnight at room temperature diluted in blocking solution at the concentrations indicated below, washed, and treated with secondary antibodies diluted 1:1000 in PBSTx for 6 hours at room temperature. Finally, larvae were washed in PBSTx, eyes, lower jaws, and tails were removed, and the remaining tissue was mounted in Prolong Diamond antifade mountant (Invitrogen Cat# P36970). At 14 dpf, larvae were euthanized on ice and pre-fixed in 4% paraformaldehyde for 1 hour. The midbrain and forebrain were dissected in PBS, removed, and fixed overnight at room temperature in 4% paraformaldehyde. We used a modified CUBIC protocol for clearing and immunolabeling dissected 14 dpf larval brains [97]. Brains were rinsed in PBS and incubated in CUBIC 1 solution (25% wt urea, 25% wt Quadrol, and 15% wt Triton X-100 in dH2O) at 37˚C for 2-3 days. Brains were then washed, blocked, and incubated with primary antibodies as described above. After additional washing steps, brains were incubated with secondary antibodies Fluorescence in situ hybridization. 7 dpf larvae were euthanized with MS-222 and fixed in 4% paraformaldehyde for 3 hours at room temperature. Larvae were washed in PBS with 0.1% Tween-20 (PBST), dehydrated through a methanol series, and incubated in 100% methanol at -20 o C overnight.
c1qa RNA was then detected using the Advanced Cell Diagnostics (ACD) RNAscope Multiplex Fluorescence V2 Kit (ACD #323100), adapting the manufacturers protocols as previously described [98]. Briefly, larvae were air-dried and incubated with Protease Plus for 1 hour and 15 minutes at room temperature, washed in PBST and incubated with prewarmed custom probes (c1qa, c1qb, gad1b, negative control) at 40˚C overnight. A custom probe against gad1b was used as positive control, and the ACD RNAscope 4-plex Negative Control Probe was used as negative control (ACD #321831). Next, larvae were washed in saline sodium citrate (SSC) buffer with 0.1% Tween-20 (SSC/Tw), re-fixed in 4% paraformaldehyde for 10 minutes at room temperature and hybridized with the appropriate amplifier DNA (AMP-1, AMP-2) for 30 minutes each at 40˚C. Each probe was then developed by sequential application of the appropriate HRP reagent (HRP-C1, HRP-C2) for 15 minutes each at 40˚C and fluorophore (Akoya Biosciences Opal 690 and Opal 520) for 30 minutes each at 40˚C. HRP blocker was applied between each channel for 15 minutes at 40˚C. Following probe amplification and labeling, larvae were immunolabeled with rabbit anti-Cherry primary antibody and Alexa Fluor 568 secondary antibody as described above but substituting PBST for PBSTx.
Microscopy. For quantification of neuronal morphology, microglia infiltration, and c1q RNA localization, fixed and immunostained larval brains were imaged on a Leica TCS SP8 X (Leica Microsystems, Wetzlar, Germany) or Zeiss LSM 880 (Carl Zeiss Microscopy, LLC, Thornwood, New York, USA) confocal microscope. Neuronal arbors and microglia were imaged with a 40x water-immersion lens (1.10 NA). Z stacks were acquired at 1 µm per slice through the entire forebrain. To ensure comparable resolution across samples and conditions, projections outside of a single field of view at 40x were captured by tiling multiple z stacks in Leica LAS X 3.1.5.16308 software (Leica Microsystems, Wetzlar, Germany). c1q RNA localization was imaged with a 63x oil-immersion lens (1.40 NA) and 3x zoom. Z stacks were acquired at 0.3 µm per slice. Microglial dynamics were imaged live in 7 dpf y321Et; UAS:GFP; mpeg1:mCherryTg heterozygotes raised GF or CVZ on a Nikon CSU-W1 SoRa spinning disk confocal microscope (Nikon Instruments, Inc., Melville, New York, USA) with 20x lens, imaging a z stack with 1 µm slice depth encompassing the larval forebrain every 30 or 60 seconds for 20 minutes.
Time series imaged every 30 seconds were downsampled to every 60 seconds for consistency across the dataset. Image analysis. Neuronal morphology was extracted from confocal z stacks by 3D segmentation in Imaris software (Oxford Instruments, Zurich, Switzerland) as previously described [52]. Briefly, Imaris Filament Tracer was used in "AutoPath" mode to semi-automatically segment neurites based on RFP fluorescence signal. The number of recombined cells in each brain varied from none to dozens; only arbors that could be accurately distinguished without overlap from neighboring cells were segmented.
Statistics and a .swc representation were exported from each filament object for further analysis and visualization. The number of cells in the GFP-positive population was estimated by threshold-based surface creation using the "split touching objects" function and identical estimated cell size applied across all samples and conditions. vTel y321 neuropil density was estimated from confocal Z stacks using 3D surface objects created in Imaris. This analysis was performed blind to condition. For each image, a 3D surface corresponding to the surface of the forebrain was created by semi-automatic local contrast detection in a brightfield image. This surface was used to mask vTel y321 :GFP and mpeg1:mCherry channels, excluding signal outside of the forebrain. Signal-based intensity thresholding was used to create a 3D surface of the remaining vTel y321 :GFP signal. The volume of the vTel y321 :GFP surface was computed and divided by the volume of the forebrain surface to calculate the density of vTel y321 neuropil in the forebrain. Microglial morphology was quantified by semi-automatic signal-based segmentation with Imaris Filament Tracer in each image and, for measurements of morphological variance, across each time series. Cumulative intensity projections were generated in the FIJI distribution of ImageJ, [99] manually segmented to exclude mpeg1:mCherry signal from circulating macrophages outside of the brain, and % area filled was measured.
Image registration. Average CVZ and GF forebrains were generated separately using vTel y321 GFP signal as a reference. Specifically, a single brain with representative size and orientation was first chosen as a reference for each condition. Each additional brain was then registered to these templates using the Computational Morphology Toolkit (CMTK; http://nitrc.org/projects/cmtk), executing the following parameters via the terminal: -awr 01 -T 4 -X 26 -C 8 -G 80 -R 4 -A '--accuracy 0.4' -W '-accuracy 0.4' -s. The resulting transformed vTel y321 GFP images were then averaged to generate a single average forebrain for each condition. Each original image was then registered again, this time to the condition average in CMTK with the parameters described above. This generated transformed images and image rotation, translation, scaling, shearing, and centering coordinates used to achieve that transformation. These transformation coordinates were then applied to SWC-formatted neurons using Natverse package functions in R [100]. Formatting neurons as SWC files converts them into a matrix of (x,y,z) coordinates so that they can be read across platforms. For each condition, transformed neurons were exported from R in SWC format and imported into the average vTel y321 GFP forebrain for 3D visualization in Imaris software (Oxford Instruments, Concord MA).
Morpholino injection. One-to two-cell stage embryos were injected with 1-2 nl of translation-blocking morpholino (GeneTools) targeting irf8 (irf8 MO atg ; 5'-TCAGTCTGCGACCGCCCGAGTTCAT-3'), [56] c1qa (5'-GCAAAGAAAGCTGATGGCTGCATCC Single-cell RNA sequencing analysis. Microglial expression profiles from CV and GF larvae were compared in RStudio (RStudio Team, 2020) using scRNA-seq data from Massaquoi and colleagues (Massaquoi et al., 2022). mpeg1 + immune cell cluster 36 was subclustered using Seurat v4.0.4 [101] software package for R, v4.1.1 (R Core Team, 2021). Briefly, cluster 36 reads were scaled and centered using the ScaleData command, and data were clustered using FindNeighbors and FindClusters commands. RunPCA and ElbowPlot were used to evaluate how many principal components to include. RunUMAP was applied using 4 principal components and resolution 1.25, which was empirically determined by evaluating separation of clusters with resolution values ranging from 0.5 to 2.0. Significantly enriched genes in each of the 9 resulting clusters were generated using the FindConservedClusters command. Expression differences between CV and GF cells in each subcluster were extracted using the FindMarkers command. Transcriptional similarity between microglia and macrophages makes it difficult to separate the two based on individual marker genes. To identify microglial clusters, we used a "microglial fingerprint" based on previously described microglial gene expression in zebrafish, mice, and humans [102]. We extracted genes previously identified as common between 5 dpf and 7 dpf zebrafish that are also conserved in murine and human microglia, and added several additional well-studied microglial genes to this unbiased conserved fingerprint, including apoeb, c1qa, c1qb, hexb, mafb, plxnb2a, sall1a, and slc7a7 ( Figure 6B, Supplemental Table   1) [102]. It is likely that zebrafish microglia strongly express additional genes not represented on this list, but we hypothesized that focusing only on genes conserved in mice and humans would facilitate identification of cell clusters with features that are well-studied across taxa.
Statistics. Groups were statistically compared using Prism 8 software (Graphad, San Diego, CA, USA) as described in the figure legends. Gaussian distribution of each group was examined by a D'Agostino-Pearson test of skewness and kurtosis. Unpaired t tests were applied to data with Gaussian distribution and equal standard deviation, and Welch's correction was applied if standard deviation of the two groups was unequal. Mann-Whitney U tests were applied to data that were not normally distributed.
More than two groups were compared using one-way analysis of variance (ANOVA) with Tukey's multiple comparisons test, or if the data were not normally distributed, a Kruskal-Wallis test with Dunn's multiple comparisons test. P < 0.05 was considered statistically significant. Outliers were not removed   The total number of vTel y321 GFP neurons is reduced in 7 dpf GF larvae relative to CVZ controls (n = 24 CVZ and 22 GF larvae; Unpaired t-test), but not in 14 dpf XGF larvae relative to CVZ controls (n = 14 CVZ and 12 XGF larvae; Mann-Whitney U test). (C-E) Total arbor length (C) and arbor depth (E) are increased and average branch length is unchanged (D) in 7 dpf GF larvae relative to CVZ controls (n = 73 neurons from 24 CVZ larvae and 69 neurons from 25 GF larvae; Mann-Whitney U tests) and in 14 dpf XGF larvae relative to CVZ controls (n = 69 neurons from 14 CVZ larvae and 46 neurons from 13 XGF larvae; Mann-Whitney U tests). ns, not significant; *, P<.05; **, P<.01; ***, P<.001; ****, P<.0001. Solid red line represents the median, dotted red lines represent the upper and lower quartiles.  Dorsal views of maximum-intensity projections of mpeg1:mCherryTg (A; microglia and macrophages, magenta) and vTel y321 GFP (B; neurons, green) from 7 dpf larvae that are CVZ (gray), GF (aqua), or mono-associated with Aeromonas veronii (purple; strain ZOR0001). Dotted lines indicate approximate forebrain boundary, segmented from the corresponding brightfield image. (C) The number of forebrain microglia, normalized to total forebrain volume, is decreased in GF larvae relative to CVZ larvae. This defect is rescued by mono-association with Aeromonas veronii (Aero.; strain ZOR0001) and Staphylococcus sp. (Staph.; strain ZWU0021) (n = 84 CVZ, 92 GF, 23 Aero., 10 Staph., and 11 Ent. larvae; Kruskal-Wallis test with Dunn's multiple comparisons). (D) vTel y321 neuropil density is increased in GF larvae relative to CVZ larvae, and this defect is rescued by mono-association with Aeromonas veronii (Aero.; strain ZOR0001) and Enterobacter cloacae (Ent.; strain ZOR0014) (n = 105 CVZ, 98 GF, 32 Aero., 10 Staph., and 11 Ent. larvae; Brown-Forsythe and Welch ANOVA tests). (E) Dorsal views of maximum-intensity projections of vTel y321 GFP (neurons, green) and mpeg1:mCherryTg (microglia and macrophages, magenta) in 7 dpf larvae injected at the 1-cell stage with either random control morpholino (Rdm Ctrl, gray) or irf8 translation-blocking morpholino (irf8 MO, aqua). (F) The number of forebrain microglia, normalized to total forebrain volume, is reduced in irf8 MO larvae relative to uninjected or random control-injected siblings (n = 17 uninjected, 22 random control, and 15 irf8 MO larvae; One-way ANOVA with Tukey's multiple comparisons test). (G) vTel y321 neuropil density is increased in irf8 MO larvae relative to uninjected or random control-injected siblings (n = 17 uninjected, 22 random control, and 15 irf8 MO larvae; One-way ANOVA with Tukey's multiple comparisons test). *, P<.05; **, P<.01; ***, P<.001; ****, P<.0001. Solid red line represents the median, dotted red lines represent the upper and lower quartiles. Mann-Whitney U tests). (D) Maximum-intensity Z-projections of representative mpeg1:mCherryTg-positive microglia (magenta) and vTel y321 neurons (green), from CVZ (gray) and GF (aqua) larvae, every five minutes across a 20-minute time series. Arrow indicates a rapidly retracting protrusion and arrowhead indicates an extending protrusion that likely envelops an unlabeled neuronal soma. (E, F) Mean-normalized length variance (E) and mean-normalized segments variance (F) of vTel y321 -embedded microglia across the time series are similar in GF larvae and CVZ siblings (n = 28 microglia from 4 CVZ larvae and 28 microglia from 3 GF larvae; Unpaired t-test for mean-normalized segments variance; Mann-Whitney U test for mean-normalized length variance). Solid lines represent the mean, dotted lines represent SEM. ns, not significant. Solid red line represents the median, dotted red lines represent the upper and lower quartiles.  Table 1. (C) Average relative expression level (color) and percent of clustered cells (dot size) expressing ramified, amoeboid, and proliferative microglial markers in clusters 1, 2, and 4. (D) Number of included genes (dot size) and adjusted P-value (color) for gene ontology (GO) terms expressed in ramified microglia (cluster 4, top) and amoeboid microglia (cluster 1, bottom). GO-term identities are included in Supplemental Table 2. (E). Average relative expression level (color) and percent of amoeboid (cluster 1, orange) or ramified (cluster 4, teal) cells (dot size) from CVZ or GF larvae that express complement pathway transcripts. c1q expression is promoted by the microbiota and required for vTel y321 neuronal arborization. (A) Representative maximum intensity projections of fluorescence in situ hybridization against c1qa (green) and antibody labeling against mpeg1:mCherryTg (microglia, magenta) in the forebrain of 7 dpf larvae raised GF or CVZ. (B) Microglial volume is similar in GF and CVZ larvae. (C) c1qa intensity per microglia, normalized by microglial volume, is decreased in microglia in GF larvae relative to microglia in CVZ larvae (n = 36 microglia from 14 CVZ larvae and 51 microglia from 17 GF larvae; Mann-Whitney U tests). Note that c1qa signal was undetectable in some microglia, more often in larvae raised GF than CVZ. (D) c1qa intensity per punctum is decreased in microglia in GF larvae relative to microglia in CVZ larvae (n = 18 c1qa puncta from 14 CVZ larvae and 7 c1qa puncta from 17 GF larvae; Mann-Whitney U test). (E) Representative maximum-intensity projections of vTel y321 GFP (neurons, green) and mpeg1:mCherryTg (microglia and macrophages, magenta) in 7 dpf larvae either not injected (uninjected) or coinjected at the 1-cell stage with c1qa and c1qb translation-blocking morpholinos (c1q MO, aqua). Dotted lines indicate approximate forebrain boundary, segmented from the corresponding brightfield image. (F) The number of forebrain microglia, normalized to total forebrain volume, is similar in c1q MO, uninjected, and random control-injected larvae (n = 25 uninjected, 21 random control, and 20 c1q MO larvae; One-way ANOVA with Tukey's multiple comparisons test). (G) vTel y321 neuropil density is increased in c1q MO larvae relative to uninjected or random control-injected siblings (n = 25 uninjected, 21 random control, and 20 c1q MO larvae; One-way ANOVA with Tukey's multiple comparisons test). ns, not significant; *, P<.05; ***, P<.001. Solid red line represents the median, dotted red lines represent the upper and lower quartiles.  The microbiota refines vTel y321 targeting. Dorsal (top) and lateral (bottom) views of vTel y321 neurons from (A) 7 dpf CVZ (gray) and GF (aqua) larvae and (B) 14 dpf CVZ (gray) and XGF (aqua) larvae registered to an average vTel y321 nucleus (transparent 3D model) from each condition and developmental stage. Average vTel y321 nuclei do not incorporate sparse neuronal somata at the periphery, which are within the forebrain boundary. Neurons right of the dotted line in the factor analysis plots in Figure 3H and J are indicated in orange.

Fig S3.
The microbiota is required for normal forebrain microglial Z position. (A) Representative dorsal views of maximum-intensity projections of mpeg1:mCherryTg (microglia and macrophages, magenta) and vTel y321 GFP (neurons, green) in 7 dpf CVZ (gray) or GF (aqua) larvae. Dotted lines indicate approximate forebrain boundary, segmented from the corresponding brightfield image. (B-D) The number of forebrain microglia, normalized to total forebrain volume (B), is reduced in GF larvae relative to CVZ siblings, while vTel y321 neuropil density (C) and the position of the center of mass of the vTel y321 neuropil, normalized to forebrain size (D), are increased in GF larvae relative to CVZ siblings (n = 8 CVZ and 8 GF larvae; Unpaired t-test). (E) 3D position of individual forebrain microglia from CVZ (left) and GF (right) larvae (n = 319 microglia from 8 CVZ larvae 208 microglia from 8 GF larvae). Z position is indicated by color. (F) Average microglial Z position is significantly reduced in GF larvae relative to CVZ siblings (n = 319 microglia from 8 CVZ larvae 208 microglia from 8 GF larvae; Welch's t-test). *, P<.05; **, P<.01; ****, P<.0001. Solid red line represents the median, dotted red lines represent the upper and lower quartiles. Supplemental Video 8. GF forebrain mpeg1:mCherryTg-positive microglial dynamics. Maximum-intensity Zprojection of a 20-minute spinning disc confocal time-series in a representative GF larva, one volume imaged per minute. Table 1. Differential expression of a microglial fingerprint across immune cell clusters. Table 2. GO-term enrichment in amoeboid (cluster 1) microglia. Table 3. GO-term enrichment in ramified (cluster 4) microglia. Table 4. Genes differentially expressed between CV and GF conditions in amoeboid (cluster 1) microglia. Table 5. Genes differentially expressed between CV and GF conditions in ramified (cluster 4) microglia.